<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Hyves.net - Always in touch with your friends</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="<%=basePath%>/style/main.css" type="text/css"
			rel="stylesheet" />
		<link href="<%=basePath%>/style/style20.css" type="text/css"
			rel="stylesheet" />
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>/style/admin_style.css" />
		<link href="<%=basePath%>/style/pagination.css" type="text/css"
			rel="stylesheet" />
		<script language="javascript"
			src="<%=basePath%>/script/jquery1.3.2.js" type="text/javascript"></script>
		<script language="javascript"
			src="<%=basePath%>/script/jquery.form.js" type="text/javascript"></script>
		<script language="javascript"
			src="<%=basePath%>/script/jquery.pagination.js"
			type="text/javascript"></script>
		<script language="javascript" src="<%=basePath%>/editor/xheditor.js"
			type="text/javascript"></script>
		<script language="javascript"
			src="<%=basePath%>/datePicker/WdatePicker.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript">
				$(document).ready(function(){
				/* 下拉框二级联动 */
				$("#select-sort").change(function(){
					$.ajax({
						type : "POST",
						dataType : "html",
						url : "<%=basePath%>/info/getSubSortSelect",
						data : {
							id : $(this).attr("value")
						},
						success : function(data) {
							$("#select-subSort").html(data);
						}
					});
				});
				/* 分页插件Pagination */
				var _total_num = $("#total").val();
				$("#pagination").pagination(_total_num, {
					items_per_page : 10,
					next_show_always : false,
					prev_show_always : false,
					callback : pageselectCallback
				});
				function pageselectCallback(page_index, jq) {
					$.ajax({
						type : "POST",
						dataType : "html",
						url : "<%=basePath%>/info/infoShow",
						data : {
							page_index : page_index,
							maxResult : 10
						},
						success : function(data) {
							$("#ajax_info_list").html(data);
						}
					});
				}
				/* 新建资讯的ajax表单提交 */
				$('#infoSubmitBtn').click(function() {
					$("#infoForm").ajaxSubmit({success : function(data) {
						alert($("#infoSubSubmitBtn").val()+"成功!");
						location.reload();
					}});
					return false;
				});
			});
		</script>
	</head>
	<body>
		<div class="generalbox overview_block">
			<div
				class="generalbox_header overview_veryunevenlargecolumn_width generalbox_header_heavy">
				<div class="box_leftheader generalbox_leftheader">
					<img class="inlineicon transparentpng" height="16" alt=""
						src="<%=basePath%>/images/document.png" width="16" />
					资讯查询
				</div>
				<div class="clearer"></div>
			</div>
			<div
				class="generalbox_body generalbox_background_white overview_veryunevenlargecolumn_width">
				<div class="singlecontent_block">
					<form action="<%=basePath%>/news/addSort" method="post"
						id="newsSearchForm">
						<table width="55%" cellspacing="1" cellpadding="0" border="0">
							<tr>
								<td>
									<select name="newsSort.id" id="news_sort_select" />
									<option value="-1">
										所有栏目
									</option>
									<option value="1">
										校园快讯
									</option>
									<option value="2">
										社会热点
									</option>
									</select>
								</td>
								<td>
									<select name="newsSort.id" id="news_sort_select" />
									<option value="-1">
										所有状态
									</option>
									<option value="1">
										已审核
									</option>
									<option value="0">
										未审核
									</option>
									</select>
								</td>
								<td>
									标题：
								</td>
								<td>
									<input type="text" name="newsSort.name" />
								</td>
								<td valign="top" class="BodyTextSmall" colspan="2" align="right">
									<input type="button" id="newsSortSubmitBtn" value="查询" />
								</td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
		<div class="generalbox overview_block">
			<div
				class="generalbox_header overview_veryunevenlargecolumn_width generalbox_header_heavy">
				<div class="box_leftheader generalbox_leftheader">
					<img class="inlineicon transparentpng" height="16" alt=""
						src="<%=basePath%>/images/document.png" width="16" />
					资讯列表&nbsp;(${total })
				</div>
				<div class="clearer"></div>
			</div>
			<div
				class="generalbox_body generalbox_background_white overview_veryunevenlargecolumn_width">
				<div class="singlecontent_block">
					<input id="total" type="hidden" value="${total }" />
					<div id="ajax_info_list">
						<img alt="Loading..." src="<%=basePath%>/images/loading.gif"></img>
					</div>
					</br>
					<div id="pagination" class="pagination paging"></div>
				</div>
			</div>
		</div>
		<br />
		<br />
		<div id="news-show-div"></div>
		<div class="generalbox overview_block" id="info-edit-div">
			<div
				class="generalbox_header overview_veryunevenlargecolumn_width generalbox_header_heavy">
				<div class="box_leftheader generalbox_leftheader">
					<img class="inlineicon transparentpng" height="16" alt=""
						src="<%=basePath%>/images/document.png" width="16" />
					<a href="javascript:void()" id="newsControl">资讯新增</a>
				</div>
				<div class="clearer"></div>
			</div>
			<div
				class="generalbox_body generalbox_background_white overview_veryunevenlargecolumn_width">
				<div class="singlecontent_block">
					<form method="post" action="<%=basePath%>/info/addInfo"
						id="infoForm">
						<table width="100%" cellpadding="2" cellspacing="1" border="0">
							<tr>
								<td width="12%" class="pn-flabel pn-flabel-h">
									栏目：
								</td>
								<td colspan="1" width="38%" class="pn-fcontent">
									<s:select list="infoSortList" headerKey="0"
										headerValue="一级栏目名称" listKey="id" listValue="name"
										theme="simple" id="select-sort"/>
									<span id="select-subSort">
										<select><option>二级栏目名称</option></select>
									</span>
								</td>
								<td width="12%" class="pn-flabel pn-flabel-h">
									店铺字号：
								</td>
								<td width="38%" class="pn-fcontent">
									<input type="text" size="30" name="infoItem.name" />
								</td>
							</tr>
							<tr>
								<td width="12%" class="pn-flabel pn-flabel-h">
									人均消费：
								</td>
								<td width="38%" class="pn-fcontent">
									<input type="text" size="30" name="infoItem.per" />
								</td>
								<td width="12%" class="pn-flabel pn-flabel-h">
									联系电话：
								</td>
								<td width="38%" class="pn-fcontent">
									<input type="text" size="30" name="infoItem.tel" />
								</td>
							</tr>
							<tr>
								<td width="12%" class="pn-flabel pn-flabel-h">
									显示标题：
								</td>
								<td width="38%" class="pn-fcontent">
									<input type="text" size="30" name="infoItem.title"/>
								</td>
								<td width="12%" class="pn-flabel pn-flabel-h">
									详细地址：
								</td>
								<td width="88%" class="pn-fcontent">
									<input type="text" size="30" name="infoItem.address"/>
								</td>
							</tr>
							<tr>
								<td width="12%" class="pn-flabel">
									介绍：
								</td>
								<td colspan="3" width="88%" class="pn-fcontent">
									<textarea class="xheditor-simple" name="infoItem.intro" rows="18"
										style="width: 592px"></textarea>
								</td>
							</tr>
							<tr>
								<td width="12%" class="pn-flabel pn-flabel-h">
									发布时间：
								</td>
								<td colspan="1" width="38%" class="pn-fcontent">
									<input type="text" name="infoItem.created" size="30"
										onfocus="WdatePicker()" class="Wdate" readonly="true" />
									<div class="pn-fhelp">
										不填写则为当前时间
									</div>
								</td>
								<td width="12%" class="pn-flabel pn-flabel-h">
									地图坐标：
								</td>
								<td colspan="1" width="38%" class="pn-fcontent">
									<input type="text" size="30" />
									<div class="pn-fhelp">
										XXX,XXX
									</div>
								</td>
							</tr>
							<tr>
								<td colspan="4" class="pn-fbutton">
									<input type="button" id="infoSubmitBtn" value="发表" />
									&nbsp;
									<input type="reset" value="重置" />
								</td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
	</body>
</html>